<template>
  <div>
    <el-input v-model="inputValue" placeholder="请输入内容"></el-input>
    <el-button type="primary" @click="addRow">添加</el-button>

    <el-table :data="tableData">
      <el-table-column label="列1">
        <template slot-scope="scope">
          <el-input v-model="scope.row.column1"></el-input>
        </template>
      </el-table-column>
      <el-table-column label="列2">
        <template slot-scope="scope">
          {{ scope.row.column2 }}
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      inputValue: "",
      tableData: [],
    };
  },
  methods: {
    addRow() {
      this.tableData.push({
        column1: this.inputValue,
        column2: this.inputValue,
      });

      this.inputValue = "";
    },
  },
};
</script>
